package ${package.Controller};

import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>
import ${package.Model}.DelModelIn;
import ${package.Model}.PageModelIn;
import ${package.Model}.${entity}AddIn;
import ${package.Model}.${entity}EditIn;
import ${package.Basic}.result.ActionResult;
import ${package.Service}.${table.serviceName};
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>

/**
 * <p>
 * ${table.comment!} 前端控制器
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName??>/${package.ModuleName?replace(".","/")}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>

 @Autowired
 private ${entity}Service service;

 @RequestMapping("/save")
 @ApiOperation(value = "保存",notes = "保存",httpMethod = "POST")
 public ActionResult save(@Validated @RequestBody ${entity}AddIn in){
 return service.save(in);
 }

 @RequestMapping("/edit")
 @ApiOperation(value = "修改",notes = "修改",httpMethod = "POST")
 public ActionResult edit(@Validated @RequestBody ${entity}EditIn in){
 return service.edit(in);
 }

 @RequestMapping("/del")
 @ApiOperation(value = "删除",notes = "删除",httpMethod = "POST")
 public ActionResult del(@Validated @RequestBody DelModelIn in){
 return service.del(in);
 }

 @RequestMapping("/list")
 @ApiOperation(value = "列表",notes = "列表",httpMethod = "POST")
 public ActionResult getList(){
 return service.getList();
 }

 @RequestMapping("/pageList")
 @ApiOperation(value = "页码列表",notes = "页码列表",httpMethod = "POST")
 public ActionResult pageList(PageModelIn in){
 return service.pageList(in);
 }
 }
</#if>
